package com.citybox.web.controller.activity;

import com.citybox.domain.activity.ActivityInfoDo;
import com.citybox.infrastructure.activity.persistence.service.ActivityInfoService;
import com.citybox.shared.web.domain.R;
import com.citybox.shared.web.page.TableDataInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhao.x
 */
@Tag(name = "活动信息")
@RestController
@RequestMapping(value = "/activity")
@Slf4j
public class ActivityInfoController {

    @Resource
    private ActivityInfoService activityInfoService;

    @Operation(summary = "活动列表")
    @GetMapping(value = "/list")
    public TableDataInfo<?> pageList(ActivityInfoDo activityInfoDo) {
        return activityInfoService.pageList(activityInfoDo);
    }

    @Operation(summary = "新增活动")
    @PostMapping(value = "/save")
    public R<?> save(@RequestBody ActivityInfoDo activityInfoDo) {
        return R.ok(activityInfoService.save(activityInfoDo));
    }


}
